package commons.pool.easy.use;

import java.net.InetSocketAddress;
import java.net.Socket;

import org.apache.commons.pool2.BasePooledObjectFactory;
import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.impl.GenericObjectPool;



public class ConnectionPoolFactory {
	
	private GenericObjectPool pool;
	
	public ConnectionPoolFactory(Config config, String ip, int port) {
		BasePoolableObjectFactory 
	}
	
	

}

class ConnectionFactory extends BasePooledObjectFactory {
	
	private InetSocketAddress address;
	
	public ConnectionFactory(String ip, int port) {
		this.address = new InetSocketAddress(ip, port);
	}

	@Override
	public Object create() throws Exception {
		// TODO Auto-generated method stub
		Socket socket = new Socket();
		socket.connect(address);
		return socket;
	}

	@Override
	public PooledObject wrap(Object obj) {
		// TODO Auto-generated method stub
		return null;
	}
	
}
